import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {DashComponent} from "./pages/dash/dash.component";
import {HomeComponent} from "./pages/home/home.component";
import {AdminComponent} from "./pages/admin/admin.component";
import {OrderComponent} from "./pages/order/order.component";
import {UserComponent} from "./pages/user/user.component";
import {UserCpsComponent} from "./pages/user-cps/user-cps.component";
import {ProductComponent} from "./pages/product/product.component";
import {ActReportComponent} from "./pages/act-report/act-report.component";

const routes: Routes = [
  {path: 'act-report', component: ActReportComponent},
  {path: 'home', pathMatch: 'full', redirectTo: '/home/order'},
  {
    path: 'home', component: HomeComponent, children: [
      {path: 'order', component: OrderComponent},
      {path: 'dash', component: DashComponent},
      {path: 'user', component: UserComponent},
      {path: 'product', component: ProductComponent},
      {path: 'user-cps', component: UserCpsComponent},
      {path: 'admin', component: AdminComponent}
    ]
  },
  {path: '', pathMatch: 'full', redirectTo: '/welcome'},
  {path: 'welcome', loadChildren: () => import('./pages/welcome/welcome.module').then(m => m.WelcomeModule)}
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {
}
